1. Field of the Invention
The present invention relates to an apparatus and method for ensuring data for the purpose of confirming the normal operation of an external storage device, e.g., at least one magnetic disk drive, in an external storage system which controls the external storage device for writing and reading the data in and from recording medium such as a magnetic disk.
There is recently a tendency to demand, in a computer system, a transfer of large amounts of data at high speed, and therefore, an external (auxiliary) storage device, such as at least one magnetic disk drive, an optical disk drive (including a magneto-optical disk drive), or a magnetic tape drive, is also required to have a larger storage capacity and to transfer large amounts of data at high speed to exchange data with a host device.
In such a storage device, a data storage area to be accessed is controlled in accordance with a physical address of the recording medium and a logical address stored in the recording medium. Accordingly, in order to increase the recording density for the purpose of larger storage capacity, the data storage area is required to be accurately positioned by the mechanical operation of the storage device. Further, in such a computer system, it is required to possess an external storage controller having means to rapidly handle the erroneous operation of a storage device by means of an error detecting code, etc., so that reliability of the data can be ensured, together with an improvement of the accurate positioning technology of the recording medium itself.
On the other hand, to meet the requirement for transferring large amounts of data at high speed, an external storage device, e.g., a magnetic disk array device, has been also developed, which is mainly constituted by at least one logical device including a plurality of physical devices such as several units of disk drives and which enables plural bytes of data to be transferred in parallel between the host device and the logical device. Also, in this case, the reliability of large amounts of data is required to be ensured.
2. Description of the Related Art
Hereinafter, the description of a conventional apparatus for ensuring data in an external storage system in a computer system will be given with reference to FIGS. 1(A) and 1(B).
FIGS. 1(A) and 1(B) are a block diagram and a data format diagram each showing an apparatus for ensuring data according to a prior art.
In FIG. 1(A), indicated at 2 is a host device, e.g., a host computer in a computer system, and at 1 an external storage controller for controllably writing and reading data in and from an external storage device 3 which includes magnetic disk drives or the like, and which is adapted to write and read the data in recording media such as magnetic disks in the magnetic disk drives.
In this external storage system, when a write command is issued from the host device 2, the external storage controller 1 controllably locates the external storage device 3 at a target track, and transfers the data from the host device 2 to the external storage device 3 in which the data is written. When a read command is issued from the host device 2, the external storage controller 1 controllably locates the external storage device 3 at a target track, and transfers the data read from the device 3 to the host device 2.
In order to ensure the data transferred, data ensuring codes such as a CRC (Cyclic Redundancy Check) code, a check sum code, and an ECC (Error Correcting Code) are used. In the external storage controller 1 an error detecting code generating/checking circuit 10 is provided.
The data is ensured in the following manner. When the data is to be written, the content of the data to be ensured is calculated using a specific equation, and is added as a check data to the write data which is written in the storage device 3. When the data is to be read, the data including the check data is read, and a check data is calculated from the read data excluding the previously added check data. The read data is checked by comparing the thus calculated check data with the read check data.
There are two types of recording media of the external storage device 3 in terms of data format. In one type, each recording medium is regularly divided into blocks having a fixed length. In the other type, each recording medium is divided into blocks having a variable length with a distinctive ID. In either type, the external storage controller 1 specifies the data desired to be accessed by the block with a distinctive information (block ID), and reads or writes the data by the block.
Generally, an FBA format which is one of the former type as shown in FIG. 1(B) is used. In this format, each block consists of a block ID in accordance with which the controller recognizes the block, control information including information on a defective block, a replacement block, and a block length, and data. Behind the data is written the check data such as CRC data.
The external storage controller 1 handles the data stored only in the external storage device 3. When the write command is issued from the host device 2, the controller 1 adds the check data to the write data, and writes the write data including the check data in the storage device 3. When the read command is issued from the host device 2, the controller 1 reads the check data from the data from the storage device 3, checks the read check data, and transfers the read data excluding the check data to the host device 2.
In a control process as described above, when finding a target block ID, the external storage device 3 transfers the data corresponding to the found block ID to the controller 1 on the assumption that the data to be read next should be the data corresponding to that block ID.
However, the following problems have existed in such a construction according to the prior art of FIGS. 1(A) and 1(B).
(1) As shown in FIG. 1(B), there are cases where the storage device mistakenly accesses a block (n+1) and transfers the data contained in this block, although the controller 1 designated a block (n).
For instance, a sync (synchronizing) byte as indicated by hatched lines in FIG. 1(B) is written in order to identify the block ID and the leading end of the data. If the ID of the block (n) is correctly recognized, but the sync byte of the block (n) and the block ID of the block (n+1) cannot be recognized due to a mistake in reading the sync byte or some other cause, and accordingly the sync byte of the block (n+1) is recognized instead, then the data of the block (n+1) is transferred as the data of the block (n). Thus, even if the controller 1 checks the CRC data or the like based on the received data, no abnormality is detected because a data error has not occurred. Consequently, the data of the block (n+1) is transferred to the host device 2 despite the command to read the data of the block (n).
(2) If an arrangement is made such that the block ID or the like is transferred when the data is read, no error can be detected based on the check data when the data of the block (n) is read or the data of the block n+1) is read in the case where the data to be stored in the block (n) is written in the block n+1).
More specifically, data patterns of CRC code are usually composed of all "0" or all "1". Accordingly, no information on an address of a block in which the data is to be written or read is included in the CRC code. Therefore, the CRC code cannot be used to detect the above-mentioned error.
In view of these problems, it is the main object of the invention to provide an apparatus and method for ensuring data in an external storage system which are capable of ensuring data by confirming that the external storage device writes or reads data of a target address while data transfer is being executed.
It is a further object of the invention to provide an apparatus and method for ensuring data which are capable of ensuring easily that a data of the target address is read without increasing the data storage capacity.
It is a still further object of the present invention to provide an apparatus and method which can be applied to an array storage device such as a magnetic disk array device.